package com.hnust.util;

import com.alibaba.fastjson.JSONArray;
import org.apache.poi.ss.formula.functions.T;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;

public class JsonConvert {
    public static List<Map<String,String>> JsonToListMap(String strArr){
        strArr=strArr.replace("=",":");
        List<Map<String,String>> listObjectFir = (List<Map<String,String>>) JSONArray.parse(strArr);
        List<Map<String,String>> newList=new ArrayList<>();
        for(Map<String,String> mapList : listObjectFir){
            Map<String,String> map=new HashMap<>();
            for (Map.Entry entry : mapList.entrySet()){
                map.put(String.valueOf(entry.getKey()),String.valueOf(entry.getValue()));
            }
            newList.add(map);
        }
        return newList;
    }
}
